package cn.js.sangu.unitStore.entity;

import cn.hutool.core.annotation.Alias;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 文件记录表
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName("file")
public class FileNas {

    @TableId(type = IdType.AUTO)
    private Integer id;

    @Alias("文件名称")
    private String fileName;

    @Alias("文件类型")
    private Integer fileType;

    @Alias("文件大小")
    private String fileSize;

    @Alias("文件路径")
    private String filePath;

    @Alias("文件网址")
    @TableField(exist = false)
    private String fileUrl;

    @Alias("累计下载次数")
    private Integer downCount;

    @Alias("父级id")
    private Integer parId;

    @Alias("父级路径")
    private String parPath;

    @Alias("用户id")
    private Integer userId;

    @Alias("用户昵称")
    @TableField(exist = false)
    private String username;

    @Alias("创建时间")
    @TableField(fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    private Date creatTime;

    @Alias("更新人id")
    private Integer modifier;

    @Alias("更新人名称")
    @TableField(exist = false)
    private String modifierName;

    @Alias("更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    private Date updateTime;

    @Alias("备注")
    private String remark;


}
